﻿using System;
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Silverlight.Weblog.Client.CoreBL.Widgets;
using Silverlight.Weblog.Client.Default.Widgets.BaseUI;
using Silverlight.Weblog.Client.Default.Widgets.DefaultTheme;

namespace Silverlight.Weblog.Client.Default.Widgets
{
    [Export(typeof(IBlogWidget))]
    public partial class BusinessCardSiderbarWidget : UserControlBase, IDefaultSidebarWidget
    {
        public BusinessCardSiderbarWidget()
        {
            // Required to initialize variables
            InitializeComponent();

            this.MouseEnter += new MouseEventHandler(BusinessCardSiderbarWidget_MouseEnter);
            this.popup.Child.MouseLeave += new MouseEventHandler(BusinessCardSiderbarWidget_MouseLeave);
        }

        void BusinessCardSiderbarWidget_MouseLeave(object sender, MouseEventArgs e)
        {
            GoToState(this.Collapsed.Name);
        }

        void BusinessCardSiderbarWidget_MouseEnter(object sender, MouseEventArgs e)
        {
            GoToState(this.Expanded.Name);
        }

        #region Implementation of IDefaultSidebarWidget

        public int Priority
        {
            get { return 400; }
        }

        public string HeadlineText
        {
            get { return "Business Card"; }
        }

        #endregion
    }
}